package com.atguigu.gmall.user.service.impl;

import com.atguigu.gmall.model.user.UserAddress;
import com.atguigu.gmall.user.mapper.UserAddressMapper;
import com.atguigu.gmall.user.service.UserAddressService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * ClassName: UserAddressServiceImpl
 * Package: com.atguigu.gmall.user.service.impl
 * Description:
 *
 * @Author 刘轩
 * @Create 2023-09-01 22:36
 * @Version 1.0
 */

@Service
public class UserAddressServiceImpl  implements UserAddressService {


 @Autowired
 private UserAddressMapper userAddressMapper;

 /**
  * 获取用户收获地址
  * @param userId
  * @return
  */
 @Override
 public List<UserAddress> findUserAddressList(String userId) {
  LambdaQueryWrapper<UserAddress> userAddressLambdaQueryWrapper = new LambdaQueryWrapper<>();
  userAddressLambdaQueryWrapper.eq(UserAddress::getUserId, userId);
  return userAddressMapper.selectList(userAddressLambdaQueryWrapper);


 }
}
